home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / checkbox / registries / cpuinfo.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-10-12  |  2.3 KB  |  48 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from checkbox.lib.cache import cache
  5. from checkbox.lib.conversion import string_to_type
  6. from checkbox.properties import Path
  7. from checkbox.registries.data import DataRegistry
  8. from checkbox.registries.filename import FilenameRegistry
  9. from checkbox.registries.link import LinkRegistry
  10.  
  11. class ProcessorRegistry(DataRegistry):
  12.     '''Registry for processor information.
  13.  
  14.     Each item contained in this registry consists of the information
  15.     for a single processor in the /proc/cpuinfo file.
  16.     '''
  17.     
  18.     def items(self):
  19.         items = []
  20.         for l in self.split('\n'):
  21.             pass
  22.         
  23.         items.append(('processor', LinkRegistry(self)))
  24.         return items
  25.  
  26.  
  27.  
  28. class CpuinfoRegistry(FilenameRegistry):
  29.     '''Registry for cpuinfo information.
  30.  
  31.     Each item contained in this registry consists of the processor number
  32.     as key and the corresponding processor registry as value.
  33.     '''
  34.     filename = Path(default = '/proc/cpuinfo')
  35.     
  36.     def items(self):
  37.         items = []
  38.         for d in self.split('\n\n'):
  39.             if d:
  40.                 continue
  41.             _[1][d.strip()]
  42.         
  43.         return items
  44.  
  45.     items = cache(items)
  46.  
  47. factory = CpuinfoRegistry
  48.